'use strict';
var Schema = require('mongoose').Schema,
    Model = require('../../../Base/server/controllers/Model');

var modelField = {};

//待转区
modelField.WareHouse = {
    type: Schema.ObjectId,
    ref: 'WareHouse',
    Name: '仓库',
    IsEmpty: false
};
//容器
modelField.Container = {
    type: Schema.ObjectId,
    ref: 'Container',
    Name: '容器',
    IsEmpty: false
};
//状态 0:待配送 1:配送中 2:已配送
modelField.Status = {
    type: Number
};
//要货部门
modelField.DemandDepartment = {
    type: Schema.ObjectId,
    ref: 'Department'
};
//配送数量
modelField.Qty = {
    type: Number
};
//备货时间
modelField.ReadyTime = {
    type: Date
};
//备货人
modelField.StockPerson = {
    type: Schema.ObjectId,
    ref: 'User'
};
//接收数量
modelField.ReceiveQty = {
    type: Number
};
//接收时间
modelField.ReceiveTime = {
    type: Date
};
//接收人
modelField.ReceivePerson = {
    type: Schema.ObjectId,
    ref: 'User'
};

var newModel = new Model(modelField);
newModel.addIndex({WareHouse: 1, Container: 1});
newModel.create('DeliveryRecord', '配送记录');
